Drone

A generic drone. This is the base class to manage a specific drone.

Types

Link copied to clipboard

Drone model.

Properties

Link copied to clipboard
abstract val model: Drone.Model

Drone model.

Link copied to clipboard
abstract val name: String

Drone friendly name.

Link copied to clipboard
abstract val state: DeviceState

Drone current state

Link copied to clipboard
abstract val uid: String

Drone unique identifier.

Functions

Link copied to clipboard
abstract fun connect(): Boolean

Connects the drone.

abstract fun connect(connector: DeviceConnector, vararg parameters: ConnectionParameter): Boolean

Connects the drone using the specified device connector and custom parameters.

Link copied to clipboard
abstract fun disconnect(): Boolean

Disconnects the drone.

Link copied to clipboard
abstract fun forget(): Boolean

Forgets the drone.

Link copied to clipboard
abstract fun <I : Instrument> getInstrument(instrumentClass: Class<I>): I?

Gets an instrument.

abstract fun <I : Instrument> getInstrument(instrumentClass: Class<I>, observer: Ref.Observer<I>): Ref<I>

Gets an instrument and registers an observer notified each time it changes.

Link copied to clipboard
abstract fun getName(observer: Ref.Observer<String>): Ref<String>

Gets the drone friendly name and registers an observer notified each time it changes.

Link copied to clipboard
abstract fun <T : Peripheral> getPeripheral(peripheralClass: Class<T>): T?

Gets a peripheral.

abstract fun <T : Peripheral> getPeripheral(peripheralClass: Class<T>, observer: Ref.Observer<T>): Ref<T>

Gets a peripheral and registers an observer notified each time it changes.

Link copied to clipboard
abstract fun <PI : PilotingItf> getPilotingItf(pilotingItfClass: Class<PI>): PI?

Gets a piloting interface.

abstract fun <PI : PilotingItf> getPilotingItf(pilotingItfClass: Class<PI>, observer: Ref.Observer<PI>): Ref<PI>

Gets a piloting interface and registers an observer notified each time it changes.

Link copied to clipboard
abstract fun getState(observer: Ref.Observer<DeviceState>): Ref<DeviceState>

Gets current drone state and registers an observer notified each time it changes.